<?php
    session_start();
    include("includes/connect.php");
    include("functions/registration_functions.php");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="application/json">
<title>Star Map Mobile</title>
</head>
</html>
<?php
  
	$username = $_GET['username'];
    $password = $_GET['password'];
    $username = strip_tags($username);
    $password = md5($password);

	$query = "SELECT * FROM `user_table` WHERE `username` = '$username' and `password` = '$password'";
    $result = mysql_query($query) or die("Cannot connect to database users table");
    $result2 = mysql_fetch_array($result);

    if($result2)
    {
		$_SESSION['USER'] = $_GET['username'];
		$error = 1;
		echo json_encode("SUCCESS");
	}
    else
    {
		$error = 0;
		echo json_encode("FAILURE");
	}
?>